package com.kmxd.ams.infra.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.ForkJoinPool;

/**
 * es 索引线程池
 *
 * @author nickbi
 */

@Configuration
public class EsIndexPoolConfig {

    @Value("${easy-es.global-config.threadNum:1}")
    private Integer threadNum;

    @Bean("esForkJoinPool")
    public ForkJoinPool forkJoinPool() {
        return new ForkJoinPool(threadNum);
    }
}
